code restructure