removes excess links.