Removes unused variables and controllers.