Re-generate template