Refactor to Java 6