Adjusting how script templates are rendered for added safety

such that we aren't depending on an ivar.