Update code after code review