protected ConfigBag extractConfig(Map<?,?> locationFlags, String spec, LocationRegistry registry) {
@SuppressWarnings("unchecked")
Map<String,?> globalProperties = registry.getProperties();
ParsedSpec parsedSpec = specParser.parse(spec);
String namedLocation = (String) locationFlags.get(LocationInternal.NAMED_SPEC_NAME.getName());
ConfigBag flags = ConfigBag.newInstance(parsedSpec.argsMap).putIfAbsent(locationFlags);
Map<String, Object> filteredProperties = getFilteredLocationProperties(getPrefix(), namedLocation, flags.getAllConfig(), globalProperties);
flags.putIfAbsent(filteredProperties);
return flags;
}