Ones that are sorted take precedence. The ones not sorted will sort by their keys at the end of the list. This approach makes it more generic so we can control the order if we choose in the future.