Refactor TicTacToeAI getMove method