finished a little bit of refactoring to game.js