More restrucuring fixes