refactoring Stream