Factory refactored