refactored out deactivation stuff