Update Encode/Decode functions