In the event you find the source code TLDR, indeed it seems implementing an immutable api is complex.