make decoding part of the PCollection protocol