Sort by link refactor