refactoring of the loader