refactor resultmsg implementation