Refactor of Tokenizer into utils and fixed bug when loading quick sort segments with original size check