refactor whois