Revamp the tree view sorting