Cleanup Java code