Remove some redundant codes.