Change the code according to code review