Remove duplicated code for ClosureEntities.