refine the config