restructured group of prototype in node.h, plus some minor changes