Refactor : creation of a proper class to load files