restruct all codes.

almost.