cfg struct and loadCfg