Rewrite example code to better reflect use in the wild