revise samples: refactor, cleanup