Refactor load_data