Tidying up haskell