Code cleanup following comments in pull-request #2