refactoring search_context_vars