Refactoring example based on Ralf Baumann's blog series