Update makeLink function to accept more use cases.