refactored factories, now amenable to more tests