Memoized decorator handles different functions differently