NMS-6686: Implemented most of the suggestions made by reviewers during first review.