refactoring the link_to code and its specs + close #732