stat: sort (refactoring)