Make sorting method pluggable