refactor GameEngine