the proper restructured code