optimize Scanner