-Updating the code as per code review