refactored the DotGraphRenderer.getNodes method