factor out candidate selection heuristic.