refactor controls