migration: use Comparator instead of Sorter in code