Added restructuring and corpse removal