Tighten access modifier of encode/decode()