- new code with pydantic node classes