Revised code also using new Java 8 language features