Cleanups.
Split search function out....