Refactor oauth and oauth2 providers