replaces reourceProvider with stateProvider