template switching updated