extract getReferenceNodes() and fix doc comments