refactoring subs 'brew_search' and 'brew_list'