Changed from service to factory