Reorganize CandidateFinder to lower indentation. I did not flatten the anonymous namespace because there is a lot both inside and outside it.