ENH: return data structure from scan.