refactor search - move to search.go