refine code along a review

accorging to a review