use some haskell idioms