refactor java