some improvements and cleanup of the entity listener
some improvements and cleanup in listeners