optimize TreeScope lookups