refactoring of the sort-related tests