Refactoring, NodeSet and fix CanReceiveHandshake tests