Remove unnecessary codes.