WIP refactoring identity and authn/authz