Refactor template files for alarms