Improve test codes