Act as an expert software architect. Your task is to ensure the provided codebase significantly improves its maintainability, readability, and structural cleanliness.
Follow these strict architectural and styling rules:
- Modularize: Break down large, bulky files into smaller, single-responsibility files.
- Feature Grouping: Group related files and codes belonging to the same feature into dedicated sub-folders.
- Directory Naming: Use concise lowercase directory names (for example,
components/accountandinfra/repositories). - Naming Conventions: Use PascalCase for all file names (e.g.,
UserService.ts,PaymentGateway.js).
- Encapsulation: Shift from a procedural "flat file with many functions" approach to a structured Object-Oriented approach.
- Classes & Interfaces: Extensively use Classes and Interfaces to define types, contracts, and behaviors instead of loose utility functions.
- Single Responsibility: Ensure each class or module has only one reason to change.
- Variable & Method Naming: Use camelCase for all variables, properties, and methods (e.g.,
calculateTotal(),isUserLoggedIn). - Deconstruct Long Names: Review and split excessively long identifier names into shorter, concise, yet meaningful names without losing context.
- Provide the updated folder/directory tree structure.
- Present the refactored code clearly, specifying which code belongs to which file path.
- Do not change the underlying logic or introduce new features; focus entirely on pure refactoring for maintainability.