Added condition for factory-method