Split the loader implementation into smaller classes and structs.