Simplify sort-by test