Cleaned up reactivation code