Refactor sorting methods into set_sort_data and sort_gists_data from the gists_filter method