Added memoization for subdomains utils