sweep and scan refactored in
properly resumes after build db interruption