refactoring for fqdn