Breaking up the gamestate functions.