refactor gameState