format main template file