fix #10, minor refactoring
1.7