Removed the encoding / decoding functions, and added them only where it
was needed.