Haskell implementation cleanup