Expanded hello world implementation to use higher-order function