improve test code