refactoring tv app