rebuild template