refactored Anvil.authorize into smaller methods on a named object