Renamed and moved code to Cfg class.