Code cleanup and use of ConfigParser