code restructure and aoe spell