Use flat_map in find_entries