Improved code organization and abstractions