Updated to use node.js style code