simplified handling index, add more test