refactored render tree traversal for external functionality addition