better separation code for normal and rescan scaner mode