Refactored the large cascading processNewUser function into smaller chunks each carried out by a specific function