refactoring while writing corresponding blog post