ENH: Cleanup excel.py and template.py