refactor update_config