Revert module.exports to a function