see Issue #29
refactoring, issues #28 and #24