refactor to json config, in progress