modify according to code review notes