Simplified some of the unit testing code