main template structure