Restructuring and major rewrite