finished refactoring search view