refactor of entityManagerFactory to discard cruft