Extract smaller methods in collector
Remove duplicated code in nodetransformers