Separated config code to parse config.json file and perform error checking.