Better implementation of get.node.label