From iron(III) precursor to magnetite and vice versa