Update factory.py