styling, slight refactor of search.js to remove redundancy