applied first round of code review comments