Java refactoring

From wikinotes