Refactoring, further search engine upgrade