change sorting; var refactoring related to bug 869087