Refactoring for a more intuitive example