code cleaning, better node.js support