Refactor the getEntityManagerConfiguration method.