Removed dublicate code in formulating a message