template rebuild