address issues raised in code review