speeding up MakeReferencesAndAnchors