Encapsulate encoding/decoding functions into objects; interface unchanged