support for encode/decode functions