Changing Factory to a service instead of a parameter