Factories refactoring