improve the scanner