Activity template refactor