Serialize / deserialize block types