diff --git a/simple-sql-parser.cabal b/simple-sql-parser.cabal
index 6907633..3536053 100644
--- a/simple-sql-parser.cabal
+++ b/simple-sql-parser.cabal
@@ -1,3 +1,5 @@
+cabal-version:       2.2
+
 name:                simple-sql-parser
 version:             0.6.0
 synopsis:            A parser for SQL.
@@ -11,7 +13,7 @@ description:
                      <http://jakewheat.github.io/simple-sql-parser/latest>.
 
 homepage:            http://jakewheat.github.io/simple-sql-parser/latest
-license:             BSD3
+license:             BSD-3-Clause
 license-file:        LICENSE
 author:              Jake Wheat
 maintainer:          jakewheatmail@gmail.com
@@ -19,7 +21,6 @@ copyright:           Copyright Jake Wheat 2013, 2014, 2015
 category:            Database,Language
 build-type:          Simple
 extra-source-files:  README,LICENSE,changelog
-cabal-version:       >=1.10
 bug-reports:         https://github.com/JakeWheat/simple-sql-parser/issues
 
 source-repository head
@@ -34,7 +35,19 @@ Flag fixitytest
   Description: Build fixity test exe
   Default:     False
   
+
+common shared-properties
+  default-language:    Haskell2010
+  build-depends:       base >=4 && <5,
+                       parsec >=3.1 && <3.2,
+                       mtl >=2.1 && <2.3,
+                       pretty >= 1.1 && < 1.2
+
+  ghc-options:         -Wall
+
+  
 library
+  import:              shared-properties
   exposed-modules:     Language.SQL.SimpleSQL.Pretty,
                        Language.SQL.SimpleSQL.Parse,
                        Language.SQL.SimpleSQL.Lex,
@@ -42,35 +55,17 @@ library
                        Language.SQL.SimpleSQL.Dialect
   Other-Modules:       Language.SQL.SimpleSQL.Errors,
                        Language.SQL.SimpleSQL.Combinators
-  build-depends:       base >=4 && <5,
-                       parsec >=3.1 && <3.2,
-                       mtl >=2.1 && <2.3,
-                       pretty >= 1.1 && < 1.2
-  -- hs-source-dirs:
-  default-language:    Haskell2010
-  ghc-options:         -Wall
-  other-extensions:    TupleSections,DeriveDataTypeable
 
 Test-Suite Tests
+  import:              shared-properties
   type:                exitcode-stdio-1.0
   main-is:             RunTests.lhs
-  hs-source-dirs:      .,tools
-  Build-Depends:       base >=4 && <5,
-                       parsec >=3.1 && <3.2,
-                       mtl >=2.1 && <2.3,
-                       pretty >= 1.1 && < 1.2,
+  hs-source-dirs:      tools
+  Build-Depends:       simple-sql-parser,
                        tasty >= 1.1 && < 1.3,
                        tasty-hunit >= 0.9 && < 0.11
 
-  Other-Modules:       Language.SQL.SimpleSQL.Pretty,
-                       Language.SQL.SimpleSQL.Parse,
-                       Language.SQL.SimpleSQL.Lex,
-                       Language.SQL.SimpleSQL.Syntax,
-                       Language.SQL.SimpleSQL.Errors,
-                       Language.SQL.SimpleSQL.Combinators,
-                       Language.SQL.SimpleSQL.Dialect
-
-                       Language.SQL.SimpleSQL.ErrorMessages,
+  Other-Modules:       Language.SQL.SimpleSQL.ErrorMessages,
                        Language.SQL.SimpleSQL.FullQueries,
                        Language.SQL.SimpleSQL.GroupBy,
                        Language.SQL.SimpleSQL.MySQL,
@@ -91,49 +86,27 @@ Test-Suite Tests
                        Language.SQL.SimpleSQL.ScalarExprs,
                        Language.SQL.SimpleSQL.LexerTests,
                        Language.SQL.SimpleSQL.CustomDialect
-
-  other-extensions:    TupleSections,DeriveDataTypeable
-  default-language:    Haskell2010
-  ghc-options:         -Wall -threaded
+  ghc-options:         -threaded
 
 executable SimpleSqlParserTool
+  import:              shared-properties
   main-is:             SimpleSqlParserTool.lhs
-  hs-source-dirs:      .,tools
-  Build-Depends:       base >=4 && <5,
-                       parsec >=3.1 && <3.2,
-                       mtl >=2.1 && <2.3,
-                       pretty >= 1.1 && < 1.2,
+  hs-source-dirs:      tools
+  Build-Depends:       simple-sql-parser,
                        pretty-show >= 1.6 && < 1.10
-  other-extensions:    TupleSections,DeriveDataTypeable
-  default-language:    Haskell2010
-  ghc-options:         -Wall
-  Other-Modules:       Language.SQL.SimpleSQL.Combinators
-                       Language.SQL.SimpleSQL.Dialect
-                       Language.SQL.SimpleSQL.Errors
-                       Language.SQL.SimpleSQL.Lex
-                       Language.SQL.SimpleSQL.Parse
-                       Language.SQL.SimpleSQL.Pretty
-                       Language.SQL.SimpleSQL.Syntax
-
   if flag(parserexe)
     buildable:         True
   else
     buildable:         False
 
 executable Fixity
+  import:              shared-properties
   main-is:             Fixity.lhs
-  hs-source-dirs:      .,tools
-  Build-Depends:       base >=4 && <5,
-                       parsec >=3.1 && <3.2,
-                       mtl >=2.1 && <2.3,
-                       pretty >= 1.1 && < 1.2,
+  hs-source-dirs:      tools
+  Build-Depends:       simple-sql-parser,
                        pretty-show >= 1.6 && < 1.10,
                        tasty >= 1.1 && < 1.3,
                        tasty-hunit >= 0.9 && < 0.11
-
-  other-extensions:    TupleSections,DeriveDataTypeable
-  default-language:    Haskell2010
-  ghc-options:         -Wall
   if flag(fixitytest)
     buildable:         True
   else