small refactoring in gameManager.js