employ more idiomatic haskell