Some code cleaning of cfg.py