Made code changes to reflect code review comments