old_contents: 
  function grant ({handler, ...rest}) {
    if (handler === 'express') {
      var version = 4
    }
    else if (handler === 'koa') {
      var version =
        parseInt(require('koa/package.json').version.split('.')[0]) >= 2 ? 2 : 1
    }
    else if (handler === 'hapi') {
      try {
        var pkg = require('@hapi/hapi/package.json')
      }
      catch (err) {
        var pkg = require('hapi/package.json')
      }
      var version = parseInt(pkg.version.split('.')[0]) >= 17 ? 17 : 16
    }
  
    if (/^(?:express|koa|hapi)$/.test(handler)) {
      return require(`./lib/handler/${handler}-${version}`)(rest)
    }
    else {
      return require(`./lib/handler/${handler}`)(rest)
    }
  }
  
  grant.express = (options) => {
    var handler = 'express'
    var version = 4
    return options
      ? require(`./lib/handler/${handler}-${version}`)(options)
      : require(`./lib/handler/${handler}-${version}`)
  }
  
  grant.koa = (options) => {
    var handler = 'koa'
    var version =
      parseInt(require('koa/package.json').version.split('.')[0]) >= 2 ? 2 : 1
    return options
      ? require(`./lib/handler/${handler}-${version}`)(options)
      : require(`./lib/handler/${handler}-${version}`)
  }
  
  grant.hapi = (options) => {
    var handler = 'hapi'
    try {
      var pkg = require('@hapi/hapi/package.json')
    }
    catch (err) {
      var pkg = require('hapi/package.json')
    }
    var version = parseInt(pkg.version.split('.')[0]) >= 17 ? 17 : 16
    return options
      ? require(`./lib/handler/${handler}-${version}`)(options)
      : require(`./lib/handler/${handler}-${version}`)
  }
  
  grant.node = (options) => {
    var handler = 'node'
    return options
      ? require(`./lib/handler/${handler}`)(options)
      : require(`./lib/handler/${handler}`)
  }
  
  grant.aws = (options) => {
    var handler = 'aws'
    return options
      ? require(`./lib/handler/${handler}`)(options)
      : require(`./lib/handler/${handler}`)
  }
  
  grant.vercel = (options) => {
    var handler = 'vercel'
    return options
      ? require(`./lib/handler/${handler}`)(options)
      : require(`./lib/handler/${handler}`)
  }
  
  module.exports = grant
  
new_contents: 
  function grant ({handler, ...rest}) {
    if (handler === 'express') {
      var version = 4
    }
    else if (handler === 'koa') {
      var version =
        parseInt(require('koa/package.json').version.split('.')[0]) >= 2 ? 2 : 1
    }
    else if (handler === 'hapi') {
      try {
        var pkg = require('@hapi/hapi/package.json')
      }
      catch (err) {
        var pkg = require('hapi/package.json')
      }
      var version = parseInt(pkg.version.split('.')[0]) >= 17 ? 17 : 16
    }
    return version
      ? require(`./lib/handler/${handler}-${version}`)(rest)
      : require(`./lib/handler/${handler}`)(rest)
  }
  
  grant.express = (options) => {
    var version = 4
    var handler = require(`./lib/handler/express-${version}`)
    return options ? handler(options) : handler
  }
  
  grant.koa = (options) => {
    var version =
      parseInt(require('koa/package.json').version.split('.')[0]) >= 2 ? 2 : 1
    var handler = require(`./lib/handler/koa-${version}`)
    return options ? handler(options) : handler
  }
  
  grant.hapi = (options) => {
    try {
      var pkg = require('@hapi/hapi/package.json')
    }
    catch (err) {
      var pkg = require('hapi/package.json')
    }
    var version = parseInt(pkg.version.split('.')[0]) >= 17 ? 17 : 16
    var handler = require(`./lib/handler/hapi-${version}`)
    return options ? handler(options) : handler
  }
  
  grant.node = (options) => {
    var handler = require('./lib/handler/node')
    return options ? handler(options) : handler
  }
  
  grant.vercel = (options) => {
    var handler = require('./lib/handler/vercel')
    return options ? handler(options) : handler
  }
  
  grant.aws = (options) => {
    var handler = require('./lib/handler/aws')
    return options ? handler(options) : handler
  }
  
  module.exports = grant
  
subject: Refactor entrypoints