more tsdtv refactoring