Supported node to collapse and open
Refactored code for node state