refactored nodes grabbing