Move message formatting to layout