This will help us reduce a lot of code and eventually make some things more asynchronous to allow for interactive authorization.