Update code to Java 7