Restructure the Code