Updated 'basic events' example to be more concise and reusable.