entity manager refactoring