refactoring tokenizer to move parsing function to its own place