refactor update func, and subdomain regex matching