Run the cleanup code over the entire entity