various cleanup tasks and search improvements