Rework looped searches into sort.Search