adding context, provider selection, and tests