Begin refactoring the #sort_link method