Cleaning of the script. Make new_search a generator