refactor find best move