cleanup read/write tree api