Add tests, increase code coverage