I think it's better to do if/else here to make sure only one of critical/warning is called.