Authorizaton refactor/fix.