Refactoring search history.