Minor change:
- refactored some code about the deletion method and its validation, to
give more explicit messages and reuse code