clean up optimization test case, now also avoids some memory allocation