[ted] Improve extraction and update tests