Refactor deleteAccount