Sorter made generic