Fix and Reorganize codes.