remove repeated codes.