refactor node stateClasses and stylelist calculation