So this refactor was a tiny bit more complex than that one line. change_type_names() now returns the new list instead of a string. Turns out, in the HTML builder, altering the node object is necessary for the desired result. It was working before but for reasons that I didn't know, so its good that the implementation now reflects reality. So, in the builder, the list is explicitly updated.