fix(serializer): Create a single reference to the next recursion continuation and use it throughout the function.