Improve sendmessage interface