Simplify function closure

Assign module.exports directly instead of
using an extra return statement.