refactoring of stream api. mavenized