implemented code fixes per suggestions in code review