improve the test/index.cpp