make example snippet more idiomatic