Refactored some loaders to make it easier to understand