more stream combinators, less imperative code