diff --git a/Changelog.md b/Changelog.md
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,3 +1,7 @@
+### 1.2.4.1
+
+- Remove dependency on package *safe*.
+
 ### 1.2.4
 
 - Use qualified names of custom types in the implementation of typed services.
diff --git a/NgxExport/Tools/Read.hs b/NgxExport/Tools/Read.hs
--- a/NgxExport/Tools/Read.hs
+++ b/NgxExport/Tools/Read.hs
@@ -3,7 +3,7 @@
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  NgxExport.Tools.Read
--- Copyright   :  (c) Alexey Radkov 2018-2022
+-- Copyright   :  (c) Alexey Radkov 2018-2024
 -- License     :  BSD-style
 --
 -- Maintainer  :  alexey.radkov@gmail.com
@@ -35,7 +35,7 @@
 import           Data.Aeson
 import           Data.Proxy
 import           Control.Arrow
-import           Safe
+import           Text.Read
 
 -- $description
 --
@@ -179,7 +179,7 @@
 
 instance Read a => FromByteString (Readable a) where
     type WrappedT (Readable a) = a
-    fromByteString = const $ readMay . C8.unpack
+    fromByteString = const $ readMaybe . C8.unpack
 
 instance FromJSON a => FromByteString (ReadableAsJSON a) where
     type WrappedT (ReadableAsJSON a) = a
diff --git a/NgxExport/Tools/SimpleService.hs b/NgxExport/Tools/SimpleService.hs
--- a/NgxExport/Tools/SimpleService.hs
+++ b/NgxExport/Tools/SimpleService.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TemplateHaskell, TupleSections #-}
 
 -----------------------------------------------------------------------------
 -- |
@@ -299,11 +299,11 @@
     fstRun <- newName "fstRun_"
     let nameF = nameBase f
         nameSsf = mkName $ "simpleService_" ++ nameF
-        hasConf = isJust c
+        (hasConf, conf) = maybe (False, undefined) (True ,) c
         (sNameC, typeC, readConf, unreadableConfMsg) =
             if hasConf
                 then let ((tName, tNameBase), isJSON) =
-                             first (id &&& nameBase) $ fromJust c
+                             first (id &&& nameBase) conf
                      in (mkName $ "storage_" ++ tNameBase ++ '_' : nameF
                         ,conT tName
                         ,if isJSON
diff --git a/ngx-export-tools.cabal b/ngx-export-tools.cabal
--- a/ngx-export-tools.cabal
+++ b/ngx-export-tools.cabal
@@ -1,5 +1,5 @@
 name:                       ngx-export-tools
-version:                    1.2.4
+version:                    1.2.4.1
 synopsis:                   Extra tools for Nginx Haskell module
 description:                Extra tools for
         <https://github.com/lyokha/nginx-haskell-module Nginx Haskell module>.
@@ -23,7 +23,6 @@
                           , binary >= 0.4
                           , ngx-export >= 1.7.1
                           , aeson >= 1.0
-                          , safe
 
   exposed-modules:          NgxExport.Tools
                             NgxExport.Tools.Combinators
