Simplification and refactoring or the entity listener class.