try to refactor Sort class