MAINT: Factored out _create_data_generator helper method