move template into main index and add working row add/remove code