Refactoring example based on Ralf Baumann's example