Move stuff out of search_gadgets.