sort, refactoring'