diff --git a/README.markdown b/README.markdown
--- a/README.markdown
+++ b/README.markdown
@@ -53,9 +53,13 @@
 
 &nbsp;&nbsp;&nbsp;&nbsp;&#x2612;&nbsp;&nbsp;2017-03-13  v0.6.0.0  [Split out PCRE](https://github.com/iconnect/regex/milestone/7)
 
-&nbsp;&nbsp;&nbsp;&nbsp;&#x2612;&nbsp;&nbsp;2017-03-13  v0.6.0.1  [Fix .travis.yml release-stack scriptRE](https://github.com/iconnect/regex/milestone/7)
+&nbsp;&nbsp;&nbsp;&nbsp;&#x2612;&nbsp;&nbsp;2017-03-13  v0.6.0.1  [Fix .travis.yml release-stack script](https://github.com/iconnect/regex/issues/67)
 
-&nbsp;&nbsp;&nbsp;&nbsp;&#x2610;&nbsp;&nbsp;2017-03-20  v1.0.0.0  [First stable release](https://github.com/iconnect/regex/milestone/3)
+&nbsp;&nbsp;&nbsp;&nbsp;&#x2612;&nbsp;&nbsp;2017-03-15  v0.7.0.0  [Better organization of API](https://github.com/iconnect/regex/milestone/8)
+
+&nbsp;&nbsp;&nbsp;&nbsp;&#x2610;&nbsp;&nbsp;2017-03-17  v0.8.0.0  [Add type-safe replacement templates and use TemplateHaskellQuotes](https://github.com/iconnect/regex/milestone/9)
+
+&nbsp;&nbsp;&nbsp;&nbsp;&#x2610;&nbsp;&nbsp;2017-03-31  v1.0.0.0  [First stable release](https://github.com/iconnect/regex/milestone/3)
 
 &nbsp;&nbsp;&nbsp;&nbsp;&#x2610;&nbsp;&nbsp;2017-08-31  v2.0.0.0  [Fast text replacement with benchmarks](https://github.com/iconnect/regex/milestone/4)
 
diff --git a/changelog b/changelog
--- a/changelog
+++ b/changelog
@@ -1,5 +1,12 @@
 -*-change-log-*-
 
+0.7.0.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-03-15
+  * Fix and extend Replace class (#74)
+  * Better package organisation (#73)
+  * Generalise sed' in progress (#72)
+  * compileRegex to take just a string (#68)
+  * Fix comment reference in Text.RE.PCRE in progress (#66)
+
 0.6.0.1 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-03-13
   * Fix .travis.yml release-stack script (#67)
 
diff --git a/examples/TestKit.lhs b/examples/TestKit.lhs
--- a/examples/TestKit.lhs
+++ b/examples/TestKit.lhs
@@ -38,7 +38,11 @@
 import           System.Exit
 import           System.IO
 import           Text.Printf
+import           Text.RE.Types.IsRegex
 import           Text.RE.TDFA
+import           Text.RE.TestBench.Parsers
+import           Text.RE.Tools.Grep
+import           Text.RE.Tools.Sed
 \end{code}
 
 
@@ -66,11 +70,11 @@
 bumpVersion :: String -> IO ()
 bumpVersion vrn_s = do
     vrn0 <- readCurrentVersion
-    rex' <- compileRegex () $ printf "- \\[[xX]\\].*%d\\.%d\\.%d\\.%d" _vrn_a _vrn_b _vrn_c _vrn_d
+    rex' <- compileRegex $ printf "- \\[[xX]\\].*%d\\.%d\\.%d\\.%d" _vrn_a _vrn_b _vrn_c _vrn_d
     nada <- null . linesMatched <$> grepLines rex' "lib/md/roadmap-incl.md"
     M.when nada $
       error $ vrn_s ++ ": not ticked off in the roadmap"
-    rex  <- compileRegex () $ printf "%d\\.%d\\.%d\\.%d" _vrn_a _vrn_b _vrn_c _vrn_d
+    rex  <- compileRegex $ printf "%d\\.%d\\.%d\\.%d" _vrn_a _vrn_b _vrn_c _vrn_d
     nope <- null . linesMatched <$> grepLines rex "changelog"
     M.when nope $
       error $ vrn_s ++ ": not in the changelog"
diff --git a/examples/re-gen-cabals.lhs b/examples/re-gen-cabals.lhs
--- a/examples/re-gen-cabals.lhs
+++ b/examples/re-gen-cabals.lhs
@@ -39,6 +39,8 @@
 import           Text.Printf
 import           Text.RE.TDFA.ByteString.Lazy
 import           Text.RE.TDFA.Text                        as T
+import           Text.RE.Tools.Grep
+import           Text.RE.Tools.Sed
 
 
 main :: IO ()
@@ -303,7 +305,7 @@
         , "\\."
         , show $ _vrn_d vrn
         ]
-  rex <- compileRegex () $ "- \\[[xX]\\] +@{%date} +v"++vrn_res++" +\\[?${smy}([^]]+)"
+  rex <- compileRegex $ "- \\[[xX]\\] +@{%date} +v"++vrn_res++" +\\[?${smy}([^]]+)"
   lns <- linesMatched <$> grepLines rex "lib/md/roadmap-incl.md"
   case lns of
     [Line _ (Matches _ [mtch])] -> return $ TE.decodeUtf8 $ LBS.toStrict $ mtch !$$ [cp|smy|]
diff --git a/examples/re-gen-modules.lhs b/examples/re-gen-modules.lhs
--- a/examples/re-gen-modules.lhs
+++ b/examples/re-gen-modules.lhs
@@ -26,6 +26,7 @@
 import           System.Exit
 import           System.IO
 import           Text.RE.TDFA.ByteString.Lazy
+import           Text.RE.Tools.Sed
 
 
 main :: IO ()
diff --git a/examples/re-include.lhs b/examples/re-include.lhs
--- a/examples/re-include.lhs
+++ b/examples/re-include.lhs
@@ -31,8 +31,11 @@
 import           Prelude.Compat
 import           System.Environment
 import           TestKit
-import           Text.RE.Edit
+import           Text.RE.Tools.Edit
 import           Text.RE.TDFA.ByteString.Lazy
+import           Text.RE.TestBench.Parsers
+import           Text.RE.Tools.Grep
+import           Text.RE.Tools.Sed
 \end{code}
 
 \begin{code}
@@ -76,7 +79,7 @@
              -> Capture LBS.ByteString
              -> IO (Maybe LBS.ByteString)
 include_file _ mtch _ _ = fmap Just $
-    extract fp =<< compileRegex () re_s
+    extract fp =<< compileRegex re_s
   where
     fp    = prs_s $ captureText [cp|file|] mtch
     re_s  = prs_s $ captureText [cp|rex|]  mtch
diff --git a/examples/re-nginx-log-processor.lhs b/examples/re-nginx-log-processor.lhs
--- a/examples/re-nginx-log-processor.lhs
+++ b/examples/re-nginx-log-processor.lhs
@@ -41,8 +41,9 @@
 import           System.Environment
 import           System.Exit
 import           System.IO
-import           Text.RE.Options
-import           Text.RE.Parsers
+import           Text.RE.Tools.Sed
+import           Text.RE.Types.Options
+import           Text.RE.TestBench.Parsers
 import           Text.RE.TestBench
 import           Text.RE.PCRE.ByteString.Lazy
 import qualified Text.RE.PCRE.String                      as S
@@ -272,7 +273,7 @@
 lp_prelude :: Macros RE
 lp_prelude = runIdentity $ mkMacros mk regexType ExclCaptures lp_env
   where
-    mk   = maybe oops Identity . compileRegex noPreludeOptions
+    mk   = maybe oops Identity . compileRegexWithOptions noPreludeOptions
 
     oops = error "lp_prelude"
 
diff --git a/examples/re-prep.lhs b/examples/re-prep.lhs
--- a/examples/re-prep.lhs
+++ b/examples/re-prep.lhs
@@ -37,7 +37,9 @@
 import           System.IO
 import           TestKit
 import           Text.Heredoc
-import           Text.RE.Edit
+import           Text.RE.TestBench.Parsers
+import           Text.RE.Tools.Grep
+import           Text.RE.Tools.Sed
 import           Text.RE.TDFA.ByteString.Lazy
 import qualified Text.RE.TDFA.Text                        as TT
 \end{code}
@@ -170,12 +172,14 @@
     pd "re-prep"
     pd "re-tests"
     pd "TestKit"
-    pd "RE/Capture"
-    pd "RE/Edit"
-    pd "RE/IsRegex"
-    pd "RE/Options"
-    pd "RE/Replace"
+    pd "RE/Types/Matches"
+    pd "RE/Types/Match"
+    pd "RE/Types/Capture"
+    pd "RE/Types/IsRegex"
+    pd "RE/Types/Options"
+    pd "RE/Types/Replace"
     pd "RE/TestBench"
+    pd "RE/Tools/Edit"
     pd "RE/Tools/Grep"
     pd "RE/Tools/Lex"
     pd "RE/Tools/Sed"
@@ -199,7 +203,7 @@
         (Just fdr,Just mnm) -> pandoc_lhs ("Text.RE."<>fdr<>"."<>mnm) ("Text/"    <>fnm<>".lhs") ("docs/"<>mnm<>".html")
         _                   -> pandoc_lhs ("examples/"<>fnm<>".lhs" ) ("examples/"<>fnm<>".lhs") ("docs/"<>fnm<>".html")
       where
-        mtch = fnm TT.?=~ [re|^RE/(${fdr}(Tools|Internal)/)?${mnm}(@{%id})|]
+        mtch = fnm TT.?=~ [re|^RE/(${fdr}(Internal|PCRE|TDFA|Testbench|Tools|Types)/)?${mnm}(@{%id})|]
 \end{code}
 
 
@@ -213,7 +217,7 @@
            -> Capture LBS.ByteString
            -> IO (Maybe LBS.ByteString)
 includeDoc _ mtch _ _ = fmap Just $
-    extract fp =<< compileRegex () re_s
+    extract fp =<< compileRegex re_s
   where
     fp    = prs_s $ captureText [cp|file|] mtch
     re_s  = prs_s $ captureText [cp|rex|]  mtch
diff --git a/examples/re-tests.lhs b/examples/re-tests.lhs
--- a/examples/re-tests.lhs
+++ b/examples/re-tests.lhs
@@ -41,7 +41,6 @@
 import           Test.Tasty.SmallCheck          as SC
 import           Text.Heredoc
 import qualified Text.Regex.PCRE                as PCRE_
-
 import qualified Text.Regex.TDFA                as TDFA_
 import           Text.RE
 import           Text.RE.Internal.AddCaptureNames
@@ -51,6 +50,9 @@
 import qualified Text.RE.PCRE                   as PCRE
 import           Text.RE.TDFA                   as TDFA
 import           Text.RE.TestBench
+import           Text.RE.Types.CaptureID
+import           Text.RE.Types.IsRegex
+import           Text.RE.Types.Options
 
 import qualified Text.RE.PCRE.String            as P_ST
 import qualified Text.RE.PCRE.ByteString        as P_BS
@@ -206,12 +208,41 @@
 parsing_tests :: TestTree
 parsing_tests = testGroup "Parsing"
   [ testCase "complete check (matchM/ByteString)" $ do
-      r    <- compileRegex () $ reSource regex_
+      r <- TDFA.compileRegex $ reSource regex_
       assertEqual "Match" (B.pack <$> regex_str_match) $ B.pack str_ ?=~ r
   , testCase "matched (matchM/Text)" $ do
-      r     <- compileRegex () $ reSource regex_
-      assertEqual "matched" True $ matched $ T.pack str_ ?=~ r
+      r <- TDFA.compileRegex $ reSource regex_
+      assertBool "matched" $ matched $ T.pack str_ ?=~ r
+  , tc "TDFA.String"  TDFA.compileRegex
+  , tc "TDFA.B"     $ TDFA.compileRegex . B.unpack
+  , tc "TDFA.LBS"   $ TDFA.compileRegex . LBS.unpack
+  , tc "TDFA.T"     $ TDFA.compileRegex . T.unpack
+  , tc "TDFA.LT"    $ TDFA.compileRegex . LT.unpack
+  , tc "TDFA.S"     $ TDFA.compileRegex . s_toList
+  , tc "PCRE.String"  PCRE.compileRegex
+  , tc "PCRE.B"     $ PCRE.compileRegex . B.unpack
+  , tc "PCRE.LBS"   $ PCRE.compileRegex . LBS.unpack
+  , tc "PCRE.S"     $ PCRE.compileRegex . s_toList
   ]
+  where
+    tc :: IsRegex re s => String -> (s->IO re) -> TestTree
+    tc lab mk0 = testGroup lab
+        [ testCase "loop" $ do
+            r <- mk re_s
+            assertEqual "RE" re_s $ regexSource r
+        , testCase "Match" $ do
+            r <- mk re_s
+            assertEqual "Match" (pk <$> regex_str_match) $ matchOnce r $ pk str_
+        ]
+      where
+        mk   = makeRegex `asTypeOf` mk0
+
+        re_s = pk $ reSource regex_
+
+        pk   = mk_pk mk0
+
+        mk_pk :: Replace s' => (s'->IO re') -> String -> s'
+        mk_pk _ = packE
 \end{code}
 
 <h3>core tests</h3>
@@ -385,8 +416,8 @@
         txt     = inj "2016-01-09 2015-12-5 2015-10-05"
         txt'    = inj "2016-01-09"
 
-    re_pcre = fromMaybe oops $ PCRE.compileRegex () "[0-9]{4}-[0-9]{2}-[0-9]{2}"
-    re_tdfa = fromMaybe oops $ TDFA.compileRegex () "[0-9]{4}-[0-9]{2}-[0-9]{2}"
+    re_pcre = fromMaybe oops $ PCRE.compileRegex "[0-9]{4}-[0-9]{2}-[0-9]{2}"
+    re_tdfa = fromMaybe oops $ TDFA.compileRegex "[0-9]{4}-[0-9]{2}-[0-9]{2}"
 
     oops    = error "many_tests"
 \end{code}
@@ -610,8 +641,8 @@
         ]
     ]
   where
-    tdfa_re   = fromMaybe oops $ TDFA.compileRegex tdfa_opts ".*"
-    pcre_re   = fromMaybe oops $ PCRE.compileRegex pcre_opts ".*"
+    tdfa_re   = fromMaybe oops $ TDFA.compileRegexWithOptions tdfa_opts ".*"
+    pcre_re   = fromMaybe oops $ PCRE.compileRegexWithOptions pcre_opts ".*"
 
     tdfa_opts = makeOptions no_macs_t :: Options_ TDFA.RE TDFA_.CompOption TDFA_.ExecOption
     pcre_opts = makeOptions no_macs_p :: Options_ PCRE.RE PCRE_.CompOption PCRE_.ExecOption
@@ -662,4 +693,7 @@
 
 tdfa_prelude_macros :: [PreludeMacro]
 tdfa_prelude_macros = [minBound..maxBound]
+
+s_toList :: S.Seq Char -> [Char]
+s_toList = F.toList
 \end{code}
diff --git a/examples/re-tutorial.lhs b/examples/re-tutorial.lhs
--- a/examples/re-tutorial.lhs
+++ b/examples/re-tutorial.lhs
@@ -93,6 +93,8 @@
 options.
 \begin{code}
 import           Text.RE.TDFA.String
+import           Text.RE.Types.CaptureID
+import           Text.RE.Types.Options
 \end{code}
 If you are predominantly matching against a single type in your module
 then you will probably find it more convenient to use the relevant module
@@ -262,9 +264,9 @@
 (*=~) :: String -> RE -> Matches String
 ```
 </div>
-with `Matches` defined in `Text.RE.Capture` thus:
+with `Matches` defined in `Text.RE.Types.Capture` thus:
 
-%include "Text/RE/Capture.lhs" "^data Matches "
+%include "Text/RE/Types/Matches.lhs" "^data Matches "
 
 The critical component of the `Matches` type is the `[Match a]` in
 `allMatches`, containing the details all of each substring matched by
@@ -279,9 +281,9 @@
 ```
 </div>
 with `Match` (referenced in the definition of `Matches` above) defined
-in `Text.RE.Capture` thus:
+in `Text.RE.Types.Capture` thus:
 
-%include "Text/RE/Capture.lhs" "^data Match "
+%include "Text/RE/Types/Match.lhs" "^data Match "
 
 Like `matchesSource` above, `matchSource` retains the original search
 string, but also a `CaptureNames` field listing all of the capture
@@ -295,7 +297,7 @@
 
 Each captured substring is represented by the following `Capture` type:
 
-%include "Text/RE/Capture.lhs" "^data Capture "
+%include "Text/RE/Types/Capture.lhs" "^data Capture "
 
 Here we list the whole original search string in `captureSource` and
 the text of the sub-string captured in `capturedText`. `captureOffset`
@@ -386,12 +388,12 @@
 
 The `replaceAllCaptures` function is of type
 
-%include "Text/RE/Replace.lhs" "replaceAllCaptures ::"
+%include "Text/RE/Types/Replace.lhs" "replaceAllCaptures ::"
 
 and the `Context` and `Location` types are defined in
-`Text.RE.Replace` as follows,
+`Text.RE.Types.Replace` as follows,
 
-%include "Text/RE/Replace.lhs" "^data Context"
+%include "Text/RE/Types/Replace.lhs" "^data Context"
 
 The processing function gets applied to the captures specified by the
 `Context`, which can be directed to process `ALL` of the captures,
@@ -429,7 +431,7 @@
 evalme_RPF_02 = checkThis "evalme_RPF_02" ("[2016-01-09] [2015-12-05] [2015-10-05]") $ fixup_and_reformat_dates "2016-01-09 2015-12-5 2015-10-05"
 \end{code}
 
-`Text.RE.Replace` provides analagous functions for replacing the
+`Text.RE.Types.Replace` provides analagous functions for replacing the
 test of a single `Match` returned from `?=~`.
 
 
@@ -466,7 +468,7 @@
 you chosen back end's options, or you may need to supply a different
 set of macros to those provided in the standard environment. In which
 case you will need to know about the `Options` type, defined by each of
-the back ends in terms of the `Options_` type of `Text.RE.Options`
+the back ends in terms of the `Options_` type of `Text.RE.Types.Options`
 as follows.
 <div class='inlinecodeblock'>
 ```
@@ -476,9 +478,9 @@
 (Bear in mind that `CompOption` and `ExecOption` will be different
 types for each back end.)
 
-The `Options_` type is defined in `Text.RE.Options` as follows:
+The `Options_` type is defined in `Text.RE.Types.Options` as follows:
 
-%include "Text/RE/Options.lhs" "data Options_"
+%include "Text/RE/Types/Options.lhs" "data Options_"
 
   * `optionsMode` is an experimental feature that controls the RE
     parser.
@@ -515,7 +517,7 @@
   * `SimpleRegexOptions` this is just a simple enum type that we use to
     encode the standard options:
 
-%include "Text/RE/Options.lhs" "^data SimpleRegexOptions"
+%include "Text/RE/Types/Options.lhs" "^data SimpleRegexOptions"
 
   * `Mode`: you can specify the parser mode;
 
@@ -539,10 +541,10 @@
 \end{code}
 
 \begin{code}
-evalme_OPT_00 = checkThis "evalme_OPT_00" (2) $ countMatches $ "2016-01-09 2015-12-5 2015-10-05" *=~ check_for_failure (compileRegex () "@{%date}")
+evalme_OPT_00 = checkThis "evalme_OPT_00" (2) $ countMatches $ "2016-01-09 2015-12-5 2015-10-05" *=~ check_for_failure (compileRegex "@{%date}")
 \end{code}
 \begin{code}
-evalme_OPT_01 = checkThis "evalme_OPT_01" (1) $ countMatches $ "0a\nbb\nFe\nA5" *=~ check_for_failure (compileRegex BlockInsensitive "[0-9a-f]{2}$")
+evalme_OPT_01 = checkThis "evalme_OPT_01" (1) $ countMatches $ "0a\nbb\nFe\nA5" *=~ check_for_failure (compileRegexWith BlockInsensitive "[0-9a-f]{2}$")
 \end{code}
 
 This will allow you to compile regular expressions when the either the
@@ -579,7 +581,7 @@
     except as a development prototype (used internally in
     [Text.RE.Internal.NamedCaptures](NamedCaptures.html)).
 
-  * [Text.RE.Tools.Sed](Sed.html) using [Text.RE.Edit](Edit.html):
+  * [Text.RE.Tools.Sed](Sed.html) using [Text.RE.Tools.Edit](Edit.html):
     takes an association list of regular expressions and substitution actions,
     some input text and invokes the associated action on each line of the file
     that matches one of the REs, substituting the text returned from the action
@@ -702,7 +704,7 @@
 evalme_PMC_00 = checkThis "evalme_PMC_00" ("foo MacroID {getMacroID = \"bar\"} baz") $ expandMacros_ (Just . show) "foo @{bar} baz"
 \end{code}
 
-See [Text.RE.Replace](Replace.html) for details.
+See [Text.RE.Types.Replace](Replace.html) for details.
 
 
 Example: Parsing Replace Templates
@@ -751,7 +753,7 @@
 evalme_TPL_00 = checkThis "evalme_TPL_00" ("2016/01/11") $ date_reformat "2016-01-11"
 \end{code}
 
-See [Text.RE.Replace](Replace.html)
+See [Text.RE.Types.Replace](Replace.html)
 
 
 Example: include preprocessor
diff --git a/lib/cabal-masters/library-incl.cabal b/lib/cabal-masters/library-incl.cabal
--- a/lib/cabal-masters/library-incl.cabal
+++ b/lib/cabal-masters/library-incl.cabal
@@ -2,25 +2,19 @@
     Hs-Source-Dirs:     .
     Exposed-Modules:
       Text.RE
-      Text.RE.Capture
-      Text.RE.CaptureID
-      Text.RE.Edit
       Text.RE.Internal.AddCaptureNames
       Text.RE.Internal.EscapeREString
       Text.RE.Internal.NamedCaptures
       Text.RE.Internal.PreludeMacros
       Text.RE.Internal.QQ
-      Text.RE.IsRegex
-      Text.RE.LineNo
-      Text.RE.Options
-      Text.RE.Parsers
+      Text.RE.Types.IsRegex
       Text.RE.PCRE
       Text.RE.PCRE.ByteString
       Text.RE.PCRE.ByteString.Lazy
       Text.RE.PCRE.RE
       Text.RE.PCRE.Sequence
       Text.RE.PCRE.String
-      Text.RE.Replace
+      Text.RE.Types.Replace
       Text.RE.TDFA
       Text.RE.TDFA.ByteString
       Text.RE.TDFA.ByteString.Lazy
@@ -30,8 +24,16 @@
       Text.RE.TDFA.Text
       Text.RE.TDFA.Text.Lazy
       Text.RE.TestBench
+      Text.RE.TestBench.Parsers
+      Text.RE.Tools.Edit
       Text.RE.Tools.Grep
       Text.RE.Tools.Lex
       Text.RE.Tools.Sed
+      Text.RE.Types.Capture
+      Text.RE.Types.Match
+      Text.RE.Types.Matches
+      Text.RE.Types.CaptureID
+      Text.RE.Types.LineNo
+      Text.RE.Types.Options
 
 %build-depends array bytestring base base-compat containers hashable heredoc regex-base regex-tdfa regex-tdfa-text regex-pcre-builtin template-haskell text time time-locale-compat transformers unordered-containers
diff --git a/lib/cabal-masters/regex.cabal b/lib/cabal-masters/regex.cabal
--- a/lib/cabal-masters/regex.cabal
+++ b/lib/cabal-masters/regex.cabal
@@ -6,19 +6,13 @@
     Hs-Source-Dirs:     .
     Exposed-Modules:
       Text.RE
-      Text.RE.Capture
-      Text.RE.CaptureID
-      Text.RE.Edit
       Text.RE.Internal.AddCaptureNames
       Text.RE.Internal.EscapeREString
       Text.RE.Internal.NamedCaptures
       Text.RE.Internal.PreludeMacros
       Text.RE.Internal.QQ
-      Text.RE.IsRegex
-      Text.RE.LineNo
-      Text.RE.Options
-      Text.RE.Parsers
-      Text.RE.Replace
+      Text.RE.Types.IsRegex
+      Text.RE.Types.Replace
       Text.RE.TDFA
       Text.RE.TDFA.ByteString
       Text.RE.TDFA.ByteString.Lazy
@@ -28,9 +22,17 @@
       Text.RE.TDFA.Text
       Text.RE.TDFA.Text.Lazy
       Text.RE.TestBench
+      Text.RE.TestBench.Parsers
+      Text.RE.Tools.Edit
       Text.RE.Tools.Grep
       Text.RE.Tools.Lex
       Text.RE.Tools.Sed
+      Text.RE.Types.Capture
+      Text.RE.Types.CaptureID
+      Text.RE.Types.LineNo
+      Text.RE.Types.Match
+      Text.RE.Types.Matches
+      Text.RE.Types.Options
 
 %build-depends array bytestring base base-compat containers hashable heredoc regex-base regex-tdfa regex-tdfa-text template-haskell text time time-locale-compat transformers unordered-containers
 
diff --git a/lib/mega-regex.cabal b/lib/mega-regex.cabal
--- a/lib/mega-regex.cabal
+++ b/lib/mega-regex.cabal
@@ -1,5 +1,5 @@
 Name:                   regex
-Version:                0.6.0.1
+Version:                0.7.0.0
 Synopsis:               Toolkit for regex-base
 Description:            A Regular Expression Toolkit for regex-base with
                         Compile-time checking of RE syntax, data types for
@@ -62,7 +62,7 @@
 Source-Repository this
     Type:               git
     Location:           https://github.com/iconnect/regex.git
-    Tag:                0.6.0.1
+    Tag:                0.7.0.0
 
 
 
@@ -70,25 +70,19 @@
     Hs-Source-Dirs:     .
     Exposed-Modules:
       Text.RE
-      Text.RE.Capture
-      Text.RE.CaptureID
-      Text.RE.Edit
       Text.RE.Internal.AddCaptureNames
       Text.RE.Internal.EscapeREString
       Text.RE.Internal.NamedCaptures
       Text.RE.Internal.PreludeMacros
       Text.RE.Internal.QQ
-      Text.RE.IsRegex
-      Text.RE.LineNo
-      Text.RE.Options
-      Text.RE.Parsers
+      Text.RE.Types.IsRegex
       Text.RE.PCRE
       Text.RE.PCRE.ByteString
       Text.RE.PCRE.ByteString.Lazy
       Text.RE.PCRE.RE
       Text.RE.PCRE.Sequence
       Text.RE.PCRE.String
-      Text.RE.Replace
+      Text.RE.Types.Replace
       Text.RE.TDFA
       Text.RE.TDFA.ByteString
       Text.RE.TDFA.ByteString.Lazy
@@ -98,9 +92,17 @@
       Text.RE.TDFA.Text
       Text.RE.TDFA.Text.Lazy
       Text.RE.TestBench
+      Text.RE.TestBench.Parsers
+      Text.RE.Tools.Edit
       Text.RE.Tools.Grep
       Text.RE.Tools.Lex
       Text.RE.Tools.Sed
+      Text.RE.Types.Capture
+      Text.RE.Types.Match
+      Text.RE.Types.Matches
+      Text.RE.Types.CaptureID
+      Text.RE.Types.LineNo
+      Text.RE.Types.Options
 
     Default-Language:   Haskell2010
     GHC-Options:
@@ -144,7 +146,7 @@
       -Werror
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -173,7 +175,7 @@
       -Werror
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -199,7 +201,7 @@
       -Werror
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -224,7 +226,7 @@
       -Werror
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -252,7 +254,7 @@
       -Werror
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
       , bytestring           >= 0.10.2.0
@@ -277,7 +279,7 @@
       -Werror
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
       , bytestring           >= 0.10.2.0
@@ -299,7 +301,7 @@
       -Werror
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -328,7 +330,7 @@
       -Werror
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -360,7 +362,7 @@
       -Werror
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
       , bytestring           >= 0.10.2.0
@@ -387,7 +389,7 @@
       -Werror
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
       , bytestring           >= 0.10.2.0
@@ -414,7 +416,7 @@
       -Werror
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -451,7 +453,7 @@
       -Werror
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -489,7 +491,7 @@
       -Werror
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -532,7 +534,7 @@
       -Werror
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -577,7 +579,7 @@
       -Werror
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
diff --git a/lib/version.txt b/lib/version.txt
--- a/lib/version.txt
+++ b/lib/version.txt
@@ -1,1 +1,1 @@
-0.6.0.1
+0.7.0.0
diff --git a/regex-examples.cabal b/regex-examples.cabal
--- a/regex-examples.cabal
+++ b/regex-examples.cabal
@@ -1,5 +1,5 @@
 Name:                   regex-examples
-Version:                0.6.0.1
+Version:                0.7.0.0
 Synopsis:               Tutorial, tests and example programs for regex
 Description:            Tutorial, tests and example programs for regex,
                         a Regular Expression Toolkit for regex-base with
@@ -63,7 +63,7 @@
 Source-Repository this
     Type:               git
     Location:           https://github.com/iconnect/regex.git
-    Tag:                0.6.0.1
+    Tag:                0.7.0.0
 
 
 
@@ -82,7 +82,7 @@
       -Wwarn
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -111,7 +111,7 @@
       -Wwarn
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -137,7 +137,7 @@
       -Wwarn
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -162,7 +162,7 @@
       -Wwarn
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -190,7 +190,7 @@
       -Wwarn
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
       , bytestring           >= 0.10.2.0
@@ -215,7 +215,7 @@
       -Wwarn
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
       , bytestring           >= 0.10.2.0
@@ -237,8 +237,8 @@
       -Wwarn
 
     Build-depends:
-        regex                == 0.6.0.1
-      , regex-with-pcre      == 0.6.0.1
+        regex                == 0.7.0.0
+      , regex-with-pcre      == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -267,8 +267,8 @@
       -Wwarn
 
     Build-depends:
-        regex                == 0.6.0.1
-      , regex-with-pcre      == 0.6.0.1
+        regex                == 0.7.0.0
+      , regex-with-pcre      == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -300,7 +300,7 @@
       -Wwarn
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
       , bytestring           >= 0.10.2.0
@@ -327,7 +327,7 @@
       -Wwarn
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
       , bytestring           >= 0.10.2.0
@@ -354,8 +354,8 @@
       -Wwarn
 
     Build-depends:
-        regex                == 0.6.0.1
-      , regex-with-pcre      == 0.6.0.1
+        regex                == 0.7.0.0
+      , regex-with-pcre      == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -392,8 +392,8 @@
       -Wwarn
 
     Build-depends:
-        regex                == 0.6.0.1
-      , regex-with-pcre      == 0.6.0.1
+        regex                == 0.7.0.0
+      , regex-with-pcre      == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -431,7 +431,7 @@
       -Wwarn
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -474,7 +474,7 @@
       -Wwarn
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
@@ -519,7 +519,7 @@
       -Wwarn
 
     Build-depends:
-        regex                == 0.6.0.1
+        regex                == 0.7.0.0
       , array                >= 0.4
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
diff --git a/src/Text/RE/PCRE/ByteString.hs b/src/Text/RE/PCRE/ByteString.hs
--- a/src/Text/RE/PCRE/ByteString.hs
+++ b/src/Text/RE/PCRE/ByteString.hs
@@ -31,6 +31,7 @@
 import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
+import           Text.RE.Types.IsRegex
 import           Text.RE.Internal.AddCaptureNames
 import           Text.RE.PCRE.RE
 import qualified Text.Regex.PCRE               as PCRE
@@ -71,9 +72,11 @@
 (=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE B.ByteString where
-  matchOnce   = flip (?=~)
-  matchMany   = flip (*=~)
-  regexSource = reSource
+  matchOnce     = flip (?=~)
+  matchMany     = flip (*=~)
+  makeRegexWith = \o -> compileRegexWith o . unpackE
+  makeRegex     = compileRegex . unpackE
+  regexSource   = packE . reSource
 
 -- $tutorial
 -- We have a regex tutorial at <http://tutorial.regex.uk>. These API
diff --git a/src/Text/RE/PCRE/ByteString/Lazy.hs b/src/Text/RE/PCRE/ByteString/Lazy.hs
--- a/src/Text/RE/PCRE/ByteString/Lazy.hs
+++ b/src/Text/RE/PCRE/ByteString/Lazy.hs
@@ -31,6 +31,7 @@
 import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
+import           Text.RE.Types.IsRegex
 import           Text.RE.Internal.AddCaptureNames
 import           Text.RE.PCRE.RE
 import qualified Text.Regex.PCRE               as PCRE
@@ -71,9 +72,11 @@
 (=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE LBS.ByteString where
-  matchOnce   = flip (?=~)
-  matchMany   = flip (*=~)
-  regexSource = reSource
+  matchOnce     = flip (?=~)
+  matchMany     = flip (*=~)
+  makeRegexWith = \o -> compileRegexWith o . unpackE
+  makeRegex     = compileRegex . unpackE
+  regexSource   = packE . reSource
 
 -- $tutorial
 -- We have a regex tutorial at <http://tutorial.regex.uk>. These API
diff --git a/src/Text/RE/PCRE/Sequence.hs b/src/Text/RE/PCRE/Sequence.hs
--- a/src/Text/RE/PCRE/Sequence.hs
+++ b/src/Text/RE/PCRE/Sequence.hs
@@ -31,6 +31,7 @@
 import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
+import           Text.RE.Types.IsRegex
 import           Text.RE.Internal.AddCaptureNames
 import           Text.RE.PCRE.RE
 import qualified Text.Regex.PCRE               as PCRE
@@ -71,9 +72,11 @@
 (=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE (S.Seq Char) where
-  matchOnce   = flip (?=~)
-  matchMany   = flip (*=~)
-  regexSource = reSource
+  matchOnce     = flip (?=~)
+  matchMany     = flip (*=~)
+  makeRegexWith = \o -> compileRegexWith o . unpackE
+  makeRegex     = compileRegex . unpackE
+  regexSource   = packE . reSource
 
 -- $tutorial
 -- We have a regex tutorial at <http://tutorial.regex.uk>. These API
diff --git a/src/Text/RE/PCRE/String.hs b/src/Text/RE/PCRE/String.hs
--- a/src/Text/RE/PCRE/String.hs
+++ b/src/Text/RE/PCRE/String.hs
@@ -31,6 +31,7 @@
 import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
+import           Text.RE.Types.IsRegex
 import           Text.RE.Internal.AddCaptureNames
 import           Text.RE.PCRE.RE
 import qualified Text.Regex.PCRE               as PCRE
@@ -71,9 +72,11 @@
 (=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE String where
-  matchOnce   = flip (?=~)
-  matchMany   = flip (*=~)
-  regexSource = reSource
+  matchOnce     = flip (?=~)
+  matchMany     = flip (*=~)
+  makeRegexWith = \o -> compileRegexWith o . unpackE
+  makeRegex     = compileRegex . unpackE
+  regexSource   = packE . reSource
 
 -- $tutorial
 -- We have a regex tutorial at <http://tutorial.regex.uk>. These API
diff --git a/src/Text/RE/TDFA/ByteString.hs b/src/Text/RE/TDFA/ByteString.hs
--- a/src/Text/RE/TDFA/ByteString.hs
+++ b/src/Text/RE/TDFA/ByteString.hs
@@ -31,6 +31,7 @@
 import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
+import           Text.RE.Types.IsRegex
 import           Text.RE.Internal.AddCaptureNames
 import           Text.RE.TDFA.RE
 import qualified Text.Regex.TDFA               as TDFA
@@ -71,9 +72,11 @@
 (=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE B.ByteString where
-  matchOnce   = flip (?=~)
-  matchMany   = flip (*=~)
-  regexSource = reSource
+  matchOnce     = flip (?=~)
+  matchMany     = flip (*=~)
+  makeRegexWith = \o -> compileRegexWith o . unpackE
+  makeRegex     = compileRegex . unpackE
+  regexSource   = packE . reSource
 
 -- $tutorial
 -- We have a regex tutorial at <http://tutorial.regex.uk>. These API
diff --git a/src/Text/RE/TDFA/ByteString/Lazy.hs b/src/Text/RE/TDFA/ByteString/Lazy.hs
--- a/src/Text/RE/TDFA/ByteString/Lazy.hs
+++ b/src/Text/RE/TDFA/ByteString/Lazy.hs
@@ -31,6 +31,7 @@
 import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
+import           Text.RE.Types.IsRegex
 import           Text.RE.Internal.AddCaptureNames
 import           Text.RE.TDFA.RE
 import qualified Text.Regex.TDFA               as TDFA
@@ -71,9 +72,11 @@
 (=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE LBS.ByteString where
-  matchOnce   = flip (?=~)
-  matchMany   = flip (*=~)
-  regexSource = reSource
+  matchOnce     = flip (?=~)
+  matchMany     = flip (*=~)
+  makeRegexWith = \o -> compileRegexWith o . unpackE
+  makeRegex     = compileRegex . unpackE
+  regexSource   = packE . reSource
 
 -- $tutorial
 -- We have a regex tutorial at <http://tutorial.regex.uk>. These API
diff --git a/src/Text/RE/TDFA/Sequence.hs b/src/Text/RE/TDFA/Sequence.hs
--- a/src/Text/RE/TDFA/Sequence.hs
+++ b/src/Text/RE/TDFA/Sequence.hs
@@ -31,6 +31,7 @@
 import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
+import           Text.RE.Types.IsRegex
 import           Text.RE.Internal.AddCaptureNames
 import           Text.RE.TDFA.RE
 import qualified Text.Regex.TDFA               as TDFA
@@ -71,9 +72,11 @@
 (=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE (S.Seq Char) where
-  matchOnce   = flip (?=~)
-  matchMany   = flip (*=~)
-  regexSource = reSource
+  matchOnce     = flip (?=~)
+  matchMany     = flip (*=~)
+  makeRegexWith = \o -> compileRegexWith o . unpackE
+  makeRegex     = compileRegex . unpackE
+  regexSource   = packE . reSource
 
 -- $tutorial
 -- We have a regex tutorial at <http://tutorial.regex.uk>. These API
diff --git a/src/Text/RE/TDFA/String.hs b/src/Text/RE/TDFA/String.hs
--- a/src/Text/RE/TDFA/String.hs
+++ b/src/Text/RE/TDFA/String.hs
@@ -31,6 +31,7 @@
 import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
+import           Text.RE.Types.IsRegex
 import           Text.RE.Internal.AddCaptureNames
 import           Text.RE.TDFA.RE
 import qualified Text.Regex.TDFA               as TDFA
@@ -71,9 +72,11 @@
 (=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE String where
-  matchOnce   = flip (?=~)
-  matchMany   = flip (*=~)
-  regexSource = reSource
+  matchOnce     = flip (?=~)
+  matchMany     = flip (*=~)
+  makeRegexWith = \o -> compileRegexWith o . unpackE
+  makeRegex     = compileRegex . unpackE
+  regexSource   = packE . reSource
 
 -- $tutorial
 -- We have a regex tutorial at <http://tutorial.regex.uk>. These API
diff --git a/src/Text/RE/TDFA/Text.hs b/src/Text/RE/TDFA/Text.hs
--- a/src/Text/RE/TDFA/Text.hs
+++ b/src/Text/RE/TDFA/Text.hs
@@ -31,6 +31,7 @@
 import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
+import           Text.RE.Types.IsRegex
 import           Text.RE.Internal.AddCaptureNames
 import           Text.RE.TDFA.RE
 import qualified Text.Regex.TDFA               as TDFA
@@ -71,9 +72,11 @@
 (=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE T.Text where
-  matchOnce   = flip (?=~)
-  matchMany   = flip (*=~)
-  regexSource = reSource
+  matchOnce     = flip (?=~)
+  matchMany     = flip (*=~)
+  makeRegexWith = \o -> compileRegexWith o . unpackE
+  makeRegex     = compileRegex . unpackE
+  regexSource   = packE . reSource
 
 -- $tutorial
 -- We have a regex tutorial at <http://tutorial.regex.uk>. These API
diff --git a/src/Text/RE/TDFA/Text/Lazy.hs b/src/Text/RE/TDFA/Text/Lazy.hs
--- a/src/Text/RE/TDFA/Text/Lazy.hs
+++ b/src/Text/RE/TDFA/Text/Lazy.hs
@@ -31,6 +31,7 @@
 import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
+import           Text.RE.Types.IsRegex
 import           Text.RE.Internal.AddCaptureNames
 import           Text.RE.TDFA.RE
 import qualified Text.Regex.TDFA               as TDFA
@@ -71,9 +72,11 @@
 (=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE TL.Text where
-  matchOnce   = flip (?=~)
-  matchMany   = flip (*=~)
-  regexSource = reSource
+  matchOnce     = flip (?=~)
+  matchMany     = flip (*=~)
+  makeRegexWith = \o -> compileRegexWith o . unpackE
+  makeRegex     = compileRegex . unpackE
+  regexSource   = packE . reSource
 
 -- $tutorial
 -- We have a regex tutorial at <http://tutorial.regex.uk>. These API
