Clean up code for game.js file