Clean up Search and Indexing code