cleaned up format_search_query