setup and teardown of tree