Move {{end}} into the right template section
Refactor into SheetWriter