Extract the main logic of the game in method