This looks good, but you might want to add some checks to ensure that the file has everything in the correct format.