backport improvements from blog post
add a TODO