Optimization for tests