Refactor cachinglayer updateNodes