small refactoring, hasWon bug not fixed