inner linking and xref cleanup
kill onclose