implemented provider with factory inside