rename encoder class to encode