Separated the game logic from the control scheme.