refactor domain java classes