Refactoring per code review's comments.