Refactor to OAuth2ServiceTemplate