refactor controller input