refactoring for the HelloWorld example