moved entity repository to its own file