memoize call to get_key