change untyped _namesToValues[name] to switch statement