(add) refactoring and chanes for messagis(ok, error)