Java code cleanup