refactoring example03 to make it work