quick refacto to handle malformed json config files