ref-filter: factor out the parsing of sorting atoms