Optimizations to accommodate unit tests