Added more unit testing, achieved 99% code coverage.