optmized test code