expanded id-to-element name conversion, from upstream repo