slow but steady factory refactoring