Improve implementation of nodes cached by class