update according to code review