optimized the  folder item fetch logic