fix repo URL in .cabal file
remove unused imports and functions
add "ghc-options: -Wall" to .cabal
factorize code and remove commented functions