Large-scale refactor without passing dictionaries around.
Merge?