Refactored to remove the database types.
Removed duplicate EntityManagerFactory.