cleaned up the loading process for the document library