use makeStringSorter

and minor refactoring