Made folder scan more efficient