Factor out StrictScanner class