Instead of storing the partially complete data inside `data[last_key][-1]` it can be stored as a local variables, and appeneded to `data[last_key]` once it's complete.