Do refactoring in main.rb and game.rb