more refactoring and move searching indexing to separate worker