update Encoder class