improved unit testing and code coverage