Changes service to factory.