ValueTree clone and supporting code