Updated for Java 8