implemented changes suggested in code review