Implicit encode/decode functions