Refactoring Search/index