Not sure this intermediate dict is necessary?