Refatorando a classe Factory.