Moved handleInput, update, and render functions to their respective state functions