What is the difference between _encode() and _serialize() ?