further refactoring of EntityMapping