Restructuring
Better logging