Rewrite to process single folders recursively