some refactoring in WordResultSorter