refactoring salesforce search