refactoring: entity framework