refactors key controls.