Optimization of scan

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>