Minor changes to document template for efficiency purposes

Pretending to be a python expert, so:

-  Using `exists()` instead of `|length` when possible
-  Not fetching the zone length and zone stack more than once
-  Not checking for if it's a zone...inside a confirmed zone block