Updated to support Java 8