Encoder class