Fix factories to match new schema