Use json to create the conf, instead of writing lines directly.