Optimize the Scanner.