Refactor control to eliminate unnecessary variables.