Also fix code formatting issues and simplify the code in USRGeneration.cpp based on review comments in PR #7670.