message formatting, client side