hj refactor