Issue #145 completed, refactoring involved issue #199