do encode/decode need to be public?