refactor java model