Check same tree when restoring position
Factorize checks