Refactor to use node.js require