more Haskellized, functional stylized