Authz refactoring - work in progress