factory service provider function test