NFC of what it does, but removes references twice
This should do it