provider refactor