refactor sample_data_generator