move transaction fields and type storage into document itself