add sorting infrastructure for list refs