I don't get reason for such indirection. I mean that string "hostname" should be constant, not adding additional indirection and possible source of typos.