moved private node defs and funcs to new file, introduced memleak