Simplify tictactoe code