State management with provider