extract link functionality, first pass at #shorten