move newmessage func to message.go