C: main templete