Refactored activity loading function to use load_data() function. Error handling is now enforced.