Refactoring the code to parse and load the data.