        ;; If there is an error, we just give up on sorting.
        (safe-sort-by first paths/compare-paths)))
 
-(defn sorted-and-grouped-problems [explain-data]
-  (->> explain-data
-       :expound/problems
-       (problems/leaf-only)
-       (group-and-sort-problems (::s/failure explain-data))))
-
 (defmethod expected-str :problem/insufficient-input [_type spec-name val path problems opts]
   (let [problem (first problems)]
     (printer/format

       "")
     (let [failure nil
           non-matching-value [:expound/value-that-should-never-match]
           new-problems (group-and-sort-problems failure (map #(dissoc % :reason) problems))]
       (string/join "\n\nor "
                    (for [[[in type] problems'] new-problems]
                      (expected-str type :expound/no-spec-name non-matching-value in problems' opts)))))))

              explain-data' (problems/annotate explain-data)
              caller (:expound/caller explain-data')
              form (:expound/form explain-data')
              problems (->> explain-data'
                            :expound/problems
                            (problems/leaf-only)
                            (grouped-and-sorted-problems (::s/failure explain-data)))]

          (printer/no-trailing-whitespace
           (str
