Updated to support Java 7 & 8