fixes the limitations of #18 but of limited usefulness? we have support for custom deserialisation but not serialisation atm