small refactoring
fixed #5
refactoring, see #1
fix #1