changes to factory logic