simplify memoization