some code cleanup
incorporating the comments from reviewer...