Minor refactoring making game state extraction more robust