Cleaner scanner code… and a couple other minor changes to type definitions for brevity…