added group open/close arround each template in script