logic/entity refactoring.