small optimization on filtered_list_of_paths