Code refactoring according to feedback.