Move warning message formatting to separate module