Defunkified main template