code restructured