Refactoring according to review