templates clean & fix in index file generation