migrate to transform sorting