Refactored the MessageLoader for readability.