Re-factored to use state checkers that can be added to providers.