refactored into GameState object