command struct serialization