clean up helper a bit and add check for background scanning