pull link creation out into method