Move code outside module.exports