memoize infection function