I started abstracting the search stuff but reverted it when I decided that I want to make this into a separate cookbook.