Removing references to entity