Substantial refactoring of provider wrapping