refactor for avoid double serialization when remote and server serialier are the same. issue #2148