template and index