> It feels like this conversion is sufficiently complex to extract into a separate method

Do you mean move everything apart from the memoization, or the contents of the block?