Moved deregistering/reregistering item code to CompatHelper