factoring and refactoring factories