replaced variables 'entityAttrs', 'itemDisplayValue', 'getEntityName' to functions for for easy rewriting