Refactoring with using of Stream module