Why would node be a String? Is this crazy chef-soloness? Can we clean up this double ternary? Can we get a comment here that explains this line, especially the String possibility?