refactor delete method to use Database inheritance