issue #18 - some code cleanup