Separate main template into html chunks