Refactored findBestMove method