Correct a bug that destructs specified optional indices
Introduce the Template Method pattern to rid similar codes about tokenizers