better object memoization