Added a bunch of work around authorization.