Improving the signature of getNodes