#5 minor refactoring
#5 fix tests