adding the search box and small refactor