cleanup the factory