some optimizations to the test cases