Extracted parsing of files to json objects in separate function. Added exported function to invoke this.