replaced index with template