Improved code formatting