Refactor LinksController