Scan and route logic