refactor of object deletion at endGame()