make some of the changes as suggested by MC code review.