restructured warning/error functions