Updated script to new template format