add_dataset_ids refactoring, intermediate