Restructuring fixes