Entities refactoring (final commit before next phase refactoring).