changes as per the feedback in code review