...
You can use include blocks (or extend blocks) in Jinja to divide your templates up into multiple parts for easier maintenance. Remember to always end your templates with a newline since you might run in to issues where two parts might end up on the same line when you do includes otherwise.
Device / OS specific templates
...