refactored with Java 8