Is there a reason why the items in the dict are not in the same order as the parameters to the helper function?  It would help improve code readability (of the callers of this helper func) if they were.