Add implementation logic for TreeScope.