Refactoring class GameEngine