Latest and greatest version of factory.py