refinement in load file function