Abstract out data setting to method set_sort_data