Revert "refine index.py"

This reverts commit f917d1186a00b97a91fb5e5a06c10d116064c668.