refactoring after the second code review