code refactoring for EntityRulesAbstract