This function does lot of things
- can be called only to load the file (by passing coll as null)
- can be called to load both file and open the collection from the file.
- handles the file_cache logic
- handles fixing the collection after reading from file.
this patch is targeting to split the responsibility to
smaller function for easy maintenance and code readability.
future patch to follow for splitting the file opening and collection
opening to two different function.