improved and commented MetaData.addUnitFields method