It seems like we are duplicating code here (you have already assigned nodeName, domObject, and listToStyle, haven't you?