converted a service into a factory.