make GenerateHostname as testable