minor refactor on haskell sorts