Improvements into code style

- Inject the ManagerRegistry instead of the EntityManager