refactored so the TicTacToe class adheres to the tell don't ask principle