twitter: simplify getTopLevelNode

Change-Id: Id25ad568a79d44144ac8aaf9652e31dc7de6e864