refactoring + tokenization speed up