encapsulation in Node class