creation encode/decode methods