Improves creation and disposal of lexer.