add template and index