cleanup/optimization of the module.exports method