Add method to sort a list of data by their parent type