The old code had the least preferred (legacy) first. 

This has the most preferred (L 147 & L 152), then the alts with the one not requiring any db access before the preferred one requiring db access. I can swap the order of L 157 & 158ff if you want. If we go to a generator, the order I coded would make more sense, but idk if it makes sense to go to a generator nor whether it'd follow this code (idk how yield tracks where it left off).