dedupe: improve node visitor