template changes and add index generation