More compact template.py