Sort refactor cleanup