refactor user deactivation, add test