a few changes after code review