reuse the code to load the json config