video template refactor