prepare_data improvements.