clean the codes according to review comments.