Improved code