reorganizes layout of game.js methods