cs_cfg changed to class
minor io refactor