Refactor functions reset and newGame