Refactoring return_val_if(..., NULL)