refactored getting & setting of nodes and values