add base scanner
improve code