Refactors method that returns best move by rank