memoization for resolve