Better generics in entity manager
Removed the strange usage of generics