some optimizations in tests