renaming
extracted updateLinks() function