fix issue #20
refactor