Adding struct serialization support