update data and template