createLink: Cleanup the code.