refactor page tree