Thousands of Iraqis have emerged from more than two years of Islamic State rule to find themselves in legal limbo: marriage, death and birth certificates issued by the militants are not recognized by the Iraqi government.
As Iraqi forces retake territory from the militants, the Iraqi state is working to reverse the bureaucratic legacy of Islamic State, which subjected millions to its rule after seizing large parts of Iraq during the summer of 2014.
In a makeshift court housed in a cluster of portacabins at a camp for the displaced in Khazer near Mosul, Iraqi bureaucrats are busily converting certificates issued by the self-declared caliphate into official government documents.
Despite the violence and privation that came with Islamic State rule, life went on in Mosul and other areas controlled by the militants: people married, had children, divorced and died.
Outside the portacabin court, displaced Iraqis clutch Islamic State documents as proof not only of their rites of passage, but also of the sophisticated bureaucracy the militants ran in their ambition to create a state for all Muslims.
Untangling Islamic State's bureaucratic legacy is proving complex though.
For more details, watch the full report in the video above