Improvements for unit testing