refactoring of Json messages