finshing refactoring to use the search bar in nav