refactoring streams