refactor Sorter