This looks like a costly operation. I would rather create rootNodes List when mounting the root component.