refactoring a tiny bit of the search view to make things more readable