Cleans up the code for gameUpdate