Refactor AI-singleplayer game.