Builds appropriate links