updated from code review comments