split the creation of encoders and decoders using compile check for encode