Cleaned loader code