Cleanup object building into dataStruct, handle end-of-the-line case in reducer