Restruct code