wrap encode/decode functions in module