Implementing tree sate persistence