Use TreeWalker instead of NodeIderator. Minor style changes