Clean extern endpoint with condition