Remove an unnecessary if branch.
Refactor Scan/ScanCAS/MapScanCAS common logics