In order to better handle move commands, refactor them out of the keyDown event handler. This will enable using other input methods to trigger a move command, such as mouse clicks or touch events.