improve attribute sorter