Improved code design