applied changes according to code review