refactoring of entity removal