Component/Container: refactoring getNodes method