use module.exports, minor tweaks