Added 2 different ways of doing a factory instead of a service