improved deletion with objectType