refactoring streams not tested at all