Refactored gateway delete