move link creation back into main method