Remove useless code and Add the Factory class….