cleanup and logging of searches