Refactor cloudflare dns switch