remove use of Java 1.8 APIs