Rearrange HelloWorld code to make it more testable