improve serialisation #164