extract a config_for method