Refactor ScanEngine and ScanProcessor