InitUnits: UnitFactory was implemented with a generic design. All the types that can be created are inherited from the class passed as template parameters.