some code shortening when retrieving sort data