clean up main template file