refactoring of Json encoding proxy