Refactor game.js
Refactor bar.js