optimizing deactivate()