refactor index table