improved code and design