added support for factory