Refactor oauth logic into OAuthService