Updated some code to use Java 7 constructs