[Encoder] Refactoring: move the post-encoding exchanging in preprocessing to more reasonable function