Memoize query components