replace self with static in Factory class