code refactoring based on code review