restructure error messages