code cleanup, refactor out common structure of Link.