Modified the hostname extractor to be more accurate