Adding time_qualifier to the TreeNode, and simplifying logic in few places