Refacored calling of nodes to use queue