Improve unit testing