Improved code structure and hierarchy