refactory of helloword sample