cleaning up java code