java refactoring done