fixed game.cpp and completed refactoring