added support for removing success or error messages only
optimizations