refactoring gateway fix delete method