introducing the provider function to simplify the refresh