refactor the config_dir