code review updates

As per Joshua's comments