refactored basic_loader