Small refactoring
add tests (it's about time)
bump version