Updated to support more tree and global views.