Share code with TreeWalker