Using addRef and isRemoved would probably fix most of these codes, right?