simplify serialisation
simplify code some more