refactored loader functions