Factory code fix