* refactored first portion of RuleScanning into its own class