There's no reason to build up the whole list and then move it into a dict, it should just build the dict as it goes.