Factored out BaseNode
preparing for connectivity model
Fixed var name
Improved connectivity logic