Refactored loader