Rewrite with provider class