Refactoring and adding test coverage.
Bump version.