Refactoring from code review.