Code improvements
Added comparators for sorting refs #19386