misc improve client scan logic