Refactor KFEncoders