Refactor: map to struct for scan data