update more examples with simplified code