Make hostname retrieval prettier