centralised "visit each node" logic